import { Dog } from './modules/dog';
import * as zrender from 'zrender';
import MyCircle, { MyCircleProps } from './modules/MyCircle';
import MyRect, { MyRectProps } from './modules/MyRect';

let dogA = new Dog('小黑狗');
dogA.eat();


let Renderer: any = null;

window.onload = function () {

    Renderer = zrender.init(document.getElementById('main')!);

    let zrCircle = new zrender.Circle({
        shape: {
            cx: 400,
            cy: 400,
            r: 100
        },
        style: {
            fill: 'green',
            stroke: 'red',
            lineWidth: 10
        },
        draggable: true,
    });
    Renderer.add(zrCircle);


    let zrRect = new zrender.Rect({
        shape: {
            x: 600,
            y: 200,
            width: 100,
            height: 200
        },
        style: {
            fill: "green",
            stroke: "red",
            lineWidth: 5
        },
        draggable: true
    });
    Renderer.add(zrRect);

    let myCircle = new MyCircle({
        shape: {
            cx: 1000,
            cy: 400,
            r: 100
        },
        style: {
            fill: '#0099CC',
            stroke: 'red',
            lineWidth: 10
        }
    });
    Renderer.add(myCircle);

    let myRect = new MyRect({
        shape: {
            r: [40, 40, 40, 40],
            x: 1200,
            y: 400,
            width: 300,
            height: 200
        },
        style: {
            fill: "#0099CC",
            stroke: "red",
            lineWidth: 5
        },
        draggable: true
    });
    Renderer.add(myRect);

    Renderer.flush();
}